<template>
  <div class="Fg-form-json">
    <el-button type="text" size="mini" @click="$refs.FGDialog.open()">
      <el-tooltip content="点击此处查看表单编辑器生成的JSON表单数据" placement="top">
        <i class="el-icon-document" style="font-size:14px"></i>
      </el-tooltip>
    </el-button>
    <FGDialog
      title="生成的JSON表单数据"
      width="1000px"
      top="5vh"
      height="70vh"
      :footer="false"
      ref="FGDialog"
    >
      <Code :code="value" />
    </FGDialog>
  </div>
</template>

<script>
import Code from "@/components/code/Code";
export default {
  name: "FormJson",
  components: {
    Code,
  },
  props: {
    value: {},
  },
};
</script>

<style lang="scss" >
.Fg-form-json {
  display: inline-block;
  margin-right: 12px;
  .fg-code {
    height: 100%;
    pre {
      height: 100%;
      code {
        height: 100%;
        overflow: auto;
        box-sizing: border-box;
      }
    }
  }
}
</style>